﻿using FineCollection.Intf;




namespace FineFSM.Intf
{

    /// <summary>
    /// Base abstract interface for FSM model.
    /// </summary>
    /// <typeparam name="ST">type of state objects.</typeparam>
    /// <typeparam name="SYM">type of alphabet symbols.</typeparam>
    /// <remarks>
    /// All sets are mandatory. In all case when no items for a set, 
    /// an empty set should be returned.
    /// </remarks>
    public interface FsmModel<ST,SYM>
        where SYM : System.IComparable<SYM>
        where ST : System.IComparable<ST>
    {
        /// <summary>
        /// View to a set of states.
        /// </summary>
        ROrderSet<ST> States { get; }

        /// <summary>
        /// View to a set of symbols.
        /// </summary>
        ROrderSet<SYM> Symbols { get; }

        /// <summary>
        /// Returns all symbols that can be accepted for the specified state, 
        /// i.e. the input symbols that may switch the automation from this step
        /// to another one.
        /// </summary>
        /// <param name="state">source state.</param>
        /// <returns>acceptable input symbols.</returns>
        ROrderSet<SYM> GetStateSysmbols(ST state);

        /// <summary>
        /// Returns all possible states of step from the specified source state
        /// by the specified input symbol.
        /// </summary>
        /// <param name="state">source state.</param>
        /// <param name="symbol">input symbol.</param>
        /// <returns>set of target states; 
        ///          this set can contain several states for indeterministic automation
        ///          but at most one state for deterministic automaition.</returns>
        ROrderSet<ST> GetStepTargets(ST state, SYM symbol);

    }




}



